<template>
    <lo-modal title="选择账户" width="800px" :showButton="false" ref="pickerRef">
        <div class="picker_container">
            <merAccount @pick="pickAccount" picker></merAccount>
        </div>
    </lo-modal>
</template>

<script lang="jsx" setup>
import { ref, onMounted } from 'vue'
import merAccount from '@/views/system/merAccount'
import { useStore } from 'vuex'
import { useRouter } from 'vue-router'
const Store = useStore()
const Router = useRouter()

let promiseResolve = null;
const pickerRef = ref(null)
function open() {
    return new Promise(async (resolve, reject) => {
        promiseResolve = resolve
        pickerRef.value.open()
    })
}

function pickAccount(row) {
    console.log(row);
    promiseResolve(row)
    pickerRef.value.close()
}


defineExpose({
    open
})


</script>

<style lang="less" scoped>
.picker_container {
    width: 100%;
    height: 60vh;
    background: #f6f6f6;
    padding: 10px;
    .page{
        width: 100%;
        height: 100%;
        flex-direction: column;
        display: flex;
    }

}
</style>
